home *** CD-ROM | disk | FTP | other *** search
Wrap
<?xml version="1.0" encoding="utf-8"?> <html><head><title>CStr Function [Runtime]</title><meta name="filename" content="text/sbasic/common/03101000"/><help:css-file-link xmlns:help="http://openoffice.org/2000/help"/><!--The CSS style header method for setting styles--><style type="text/css"> table.Tabelle1{ } span.Tabelle1A{ width:8.999cm;} p.P1{ } span.T1{ font-weight:bold;} </style></head><body> <help:paragraphinfo state="E" xmlns:help="http://openoffice.org/2000/help"/><help:to-be-embedded Eid="cstr" xmlns:help="http://openoffice.org/2000/help"> <p class="Head1"><help:paragraphinfo state="U" number="1"/><help:key-word value="CStr; function" tag="kw66435_1"/><help:link Id="66435">CStr Function [Runtime]</help:link></p> <p class="Paragraph"><help:paragraphinfo state="U" number="2"/>Converts any numeric expression to a string expression.</p> <help:paragraphinfo state="E"/></help:to-be-embedded> <p class="Head2"><help:paragraphinfo state="U" number="3" xmlns:help="http://openoffice.org/2000/help"/>Syntax:</p> <p class="Paragraph"><help:paragraphinfo state="U" number="4" xmlns:help="http://openoffice.org/2000/help"/>CStr (Expression)</p> <p class="Head2"><help:paragraphinfo state="U" number="5" xmlns:help="http://openoffice.org/2000/help"/>Return value:</p> <p class="Paragraph"><help:paragraphinfo state="U" number="6" xmlns:help="http://openoffice.org/2000/help"/>String</p> <p class="Head2"><help:paragraphinfo state="U" number="7" xmlns:help="http://openoffice.org/2000/help"/>Parameters:</p> <p class="Paragraph"><help:paragraphinfo state="U" number="8" xmlns:help="http://openoffice.org/2000/help"/><span class="T1">Expression:</span> Any valid string or numeric expression that you want to convert.</p> <p class="Head2"><help:paragraphinfo state="U" number="9" xmlns:help="http://openoffice.org/2000/help"/>Expression Types and Conversion Returns</p> <table><tr class=""><th style="text-align:left;"><span class="Tabelle1A"> <p class="TextInTable"><help:paragraphinfo state="U" number="10" xmlns:help="http://openoffice.org/2000/help"/>Boolean :</p> </span></th><th style="text-align:left;"><span class="Tabelle1A"> <p class="TextInTable"><help:paragraphinfo state="U" number="11" xmlns:help="http://openoffice.org/2000/help"/>String that evaluates to either <span class="T1">True</span> or <span class="T1">False</span>.</p> </span></th></tr><tr class=""><td style="text-align:left;"><span class="Tabelle1A"> <p class="TextInTable"><help:paragraphinfo state="U" number="12" xmlns:help="http://openoffice.org/2000/help"/>Date :</p> </span></td><td style="text-align:left;"><span class="Tabelle1A"> <p class="TextInTable"><help:paragraphinfo state="U" number="13" xmlns:help="http://openoffice.org/2000/help"/>String that contains the date and time.</p> </span></td></tr><tr class=""><td style="text-align:left;"><span class="Tabelle1A"> <p class="TextInTable"><help:paragraphinfo state="U" number="14" xmlns:help="http://openoffice.org/2000/help"/>Null :</p> </span></td><td style="text-align:left;"><span class="Tabelle1A"> <p class="TextInTable"><help:paragraphinfo state="U" number="15" xmlns:help="http://openoffice.org/2000/help"/>Run-time error.</p> </span></td></tr><tr class=""><td style="text-align:left;"><span class="Tabelle1A"> <p class="TextInTable"><help:paragraphinfo state="U" number="16" xmlns:help="http://openoffice.org/2000/help"/>Empty :</p> </span></td><td style="text-align:left;"><span class="Tabelle1A"> <p class="TextInTable"><help:paragraphinfo state="U" number="17" xmlns:help="http://openoffice.org/2000/help"/>String without any characters.</p> </span></td></tr><tr class=""><td style="text-align:left;"><span class="Tabelle1A"> <p class="TextInTable"><help:paragraphinfo state="U" number="18" xmlns:help="http://openoffice.org/2000/help"/>Any :</p> </span></td><td style="text-align:left;"><span class="Tabelle1A"> <p class="TextInTable"><help:paragraphinfo state="U" number="19" xmlns:help="http://openoffice.org/2000/help"/>Corresponding number as string.</p> </span></td></tr></table> <p class="Paragraph"><help:paragraphinfo state="U" number="20" xmlns:help="http://openoffice.org/2000/help"/>Zeros at the end of a floating-point number are not included in the returned string.</p> <p class="Paragraph"><help:paragraphinfo state="S" xmlns:help="http://openoffice.org/2000/help"/><help:embedded Id="66475" Eid="errorcode" xmlns:help="http://openoffice.org/2000/help"/></p> <p class="Paragraph"><help:paragraphinfo state="S" xmlns:help="http://openoffice.org/2000/help"/><help:embedded Id="66475" Eid="err5" xmlns:help="http://openoffice.org/2000/help"/></p> <p class="Head2"><help:paragraphinfo state="U" number="21" xmlns:help="http://openoffice.org/2000/help"/>Example:</p> <p class="PropText"><help:paragraphinfo state="U" number="22" xmlns:help="http://openoffice.org/2000/help"/>Sub ExampleCSTR</p> <p class="PropText"><help:paragraphinfo state="U" number="23" xmlns:help="http://openoffice.org/2000/help"/>Dim sVar As String</p> <p class="PropText"><help:paragraphinfo state="U" number="24" xmlns:help="http://openoffice.org/2000/help"/>Msgbox CDbl(1234.5678)</p> <p class="PropText"><help:paragraphinfo state="U" number="25" xmlns:help="http://openoffice.org/2000/help"/>Msgbox CInt(1234.5678)</p> <p class="PropText"><help:paragraphinfo state="U" number="26" xmlns:help="http://openoffice.org/2000/help"/>Msgbox CLng(1234.5678)</p> <p class="PropText"><help:paragraphinfo state="U" number="27" xmlns:help="http://openoffice.org/2000/help"/>Msgbox CSng(1234.5678)</p> <p class="PropText"><help:paragraphinfo state="U" number="28" xmlns:help="http://openoffice.org/2000/help"/>sVar = CStr(1234.5678)</p> <p class="PropText"><help:paragraphinfo state="U" number="29" xmlns:help="http://openoffice.org/2000/help"/>MsgBox sVar</p> <p class="PropText"><help:paragraphinfo state="U" number="30" xmlns:help="http://openoffice.org/2000/help"/>end sub</p> </body></html>